<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
			<form id="ligerForm" action="">
				<div class="fieldset1 tabel_col clearFix">
					<div class="caption">
						<span class="title">转仓申请</span>
					</div>
					<div class="fieldBox col_50">
						<div class="label">合同号</div>
						<div class="field">
						<a href="javascript:detailPrjBtn( ${prjbsc.id})">
						<font color="blue">	${prjbsc.lsCntNo}</font>
						</a>
						</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">项目类型</div>
						<div class="field">	${prjbsc.prjTypCdNm}</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">承租人</div>
						<div class="field">	${switchvo.cstNm}</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">所属机构</div>
						<div class="field">	${switchvo.buOrgCdNm}</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">省公司</div>
						<div class="field">	${switchvo.cstMgrOrgCdPr}</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">分公司</div>
						<div class="field">	${switchvo.cstMgrOrgCdCy}</div>
					</div>
					<c:if test="${ prjbsc.isInsBiz =='1'}">
					<div class="fieldBox col_50">
						<div class="label">是否资管业务</div>
						<div class="field">	是</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">第三方机构</div>
						<div class="field">	${prjbsc.fundRasInsNm}</div>
					</div>
					</c:if>
					<c:if test="${ prjbsc.isInsBiz !='1'}">
					<div class="fieldBox col_50">
						<div class="label">是否资管业务</div>
						<div class="field">	否</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">第三方机构</div>
						<div class="field">	</div>
					</div>
					</c:if>
					<div class="fieldBox col_50">
						<div class="label">诉讼状态</div>
						<div class="field">	${switchvo.suStatus}</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">总公司档案编号</div>
						<div class="field">	${switchvo.portfolioNumber}</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">省公司档案编号</div>
						<div class="field">	${switchvo.portfolioNumberProvince}</div>
					</div>
					
					
					<div style="display: none;">
					<input type="text" id="contractNo" name="contractNo" value="${switchvo.contractNo}"/>
					</div>
					
					<div class="caption">
						<span class="title">权证转仓资料</span>						
					</div>
					<c:forEach items="${list}" var="mgrvo">
					<div class="fieldBox col_100">
						
						<table style="BORDER-COLLAPSE: collapse;" borderColor=#ECECEC height=25 cellPadding=1 width="100%" align=center border=1> 
						<tr >
						<td >
						
						<font color="blue">${mgrvo.paylistCode}</font></a>--  ${mgrvo.payTStatusNm}&nbsp;&nbsp;&nbsp;  
						
						</td>
						</tr></table>
						<div style="width: 100%; ">
							<table style="BORDER-COLLAPSE: collapse;margin-bottom:20px" borderColor=#ECECEC height=40 cellPadding=1 width="100%" align=center border=1> 
							<thead>
								<tr style="background:#E7FEF4">
									<th  style="text-align: center;width:5%;"></th>
									<th  style="text-align: center;width:20%">权证资料</th>
									<th  style="text-align: center;width:10%">资料类型</th>
									<th  style="text-align: center;width:10%">借出状态</th>
									<th  style="text-align: center;width:10%">归档地点（起）</th>									
									<th  style="text-align: center;width:10%">归档地点（终）</th>
									<th  style="text-align: center;width:10%">已归档份数</th>
									<th  style="text-align: center;width:10%">转仓份数</th>
									<th  style="text-align: center;width:18%">附件</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${mgrvo.dlist}" var="item" varStatus="status">
									<tr>
									<td  style="text-align: center; height:20px;">
									<c:if test="${ item.isValid == '1'}">
									<input type="checkbox" name="checkCount_p_${item.paylistCode}_${item.arcReceiptDetailId}">
									</c:if>
									</td>
									<td  style="text-align: left; ">${item.fileName }</td>
									<td  style="text-align: center; ">${item.dossierTempNm }</td>
									<td  style="text-align: center; ">${item.borrowStatusNm }</td>
									<td  style="text-align: center; ">${item.placeBeginNm }</td>
									<td  style="text-align: center; ">${item.placeEndNm }</td>
									<td  style="text-align: center; ">${item.dossierCountT }</td>
									<td  style="text-align: center; ">
									<c:if test="${ item.isValid == '1'}">
									    <input value="${item.switchCount }" id="thisCount_p_${item.paylistCode}_${item.arcReceiptDetailId}" name="thisCount_p_${item.paylistCode}_${item.arcReceiptDetailId}" 
									     type="text"   class="ui-textbox"  ligerui="width: 60" >
									</c:if>
										
									</td>
									<td  style="text-align: center; ">
										<c:if test="${ item.filePath != null}">
				               			<a  target="_blank" href="${item.filePath }" >查看</a>
				               			</c:if>
											<c:forEach items="${item.ulFiles}" var="file" >
											<a  target="_blank" href="${file.filePath }" >查看</a>
											</c:forEach>
										<div  class="upfiles" id="${item.eleId}" pkId="${item.eleId}"  style="text-align:left"></div>
												
									</td>
									
								<tr>
								</c:forEach>
							</tbody>
						</table>
						</div>
						
					</div>
					</c:forEach>
					
				</div>
				
				<div class="btnsBox"  style="text-align:center">
					
						<span id="saveBtn" class="sq-button sq-button-round"  onclick="save();">发起流程</span>
						<span id="closeBtn" class="sq-button sq-button-round" onclick="Remove_navTab();">取消</span> 
					
					
				</div>
			</form>
		</div>
	</div>
	<jsp:include page="../../system/sysUlFilesRec/sysUlFileRecList2.jsp" flush="true" >
			        
			            <jsp:param name="fflag" value="0"/>
			        
			            <jsp:param name="tabNm" value="ARC_MGR_DETAIL"/>
    </jsp:include>
	<script type="text/javascript">
	 	
	 	
		var grid;
		
		$(function() {
			$("#ligerForm").ligerForm({
				validate: true
			});
			
			//initGrid();//初始化交接单明细
	    });
		
		
		//保存
		function save(){
			
			var ligerForm = liger.get("ligerForm");
			if (!ligerForm.valid()) {
				$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
				return false; 
			}
			
			$("#saveBtn").attr("style","display:none;");
			var data = ligerForm.getData();//主表数据
			data["alist"] = '${alist}';
			var wait_dialog = null;
			
			$.ajax({
				type: 'post',
				dataType: 'json',
				data: data,
				url: '<%=path%>/archive/arcSwitchMain/add.do',
				beforeSend: function(){
					wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
				},success:function(msg){
					wait_dialog.close();
					if(msg.success == 1){
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success",SQ_showButtons: true});
							//if(id == "") {
								Remove_navTab();//新增，关闭当前页面
							//}
					}else{
						$("#saveBtn").attr("style","display:");
						$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
						
					}
				},error:function (XMLHttpRequest, textStatus, errorThrown) { 
					wait_dialog.close();
					$.ligerDialog.SQalert({content: "网络错误，请稍后重试",SQ_type: "error"});
				} 
			});
		}
		
	</script>
</body>
</html>